﻿@using Util
@using Util.Ui
@model IterationLife.PlatformBackEnd.AppServices.Dtos.Systems.DistrictDto
@{
    var x = @Html.EasyUi();
}
@section head {
    <script type="text/javascript">
        $(function () {
            $.easyui.newRowUrl = "/systems/District/new";
        });
    </script>
}
@section top {
    @*工具栏*@
    <div class="toolbar">
        @x.Button("添加行政区域").Icon("icon-add4").Plain().ToolTip(R.RememberSave).AddRootByTreeGrid()
            @x.Button("添加下级行政区域").Icon("icon-add").Plain().ToolTip(R.RememberSave).AddToChildByTreeGrid()
            @x.Button("编辑行政区域").Icon("icon-edit").Plain().ToolTip(R.RememberSave).EditByTreeGrid()
            @x.Button("取消编辑").Icon("icon-cancel2").Plain().CancelByTreeGrid()
            @x.Button("删除行政区域").Icon("icon-delete3").Plain().ToolTip(R.RememberSave).DeleteByTreeGrid()
            @x.Button("上 移").Icon("icon-up").Plain().ToolTip(R.RememberSave).MoveUpByTreeGrid()
            @x.Button("下 移").Icon("icon-down").Plain().ToolTip(R.RememberSave).MoveDownByTreeGrid()
            @x.Button("保 存").Icon("icon-save").Plain().SaveByTreeGrid("/systems/District/save")
            @x.Button("冻 结").Icon("icon-delete4").Plain().SubmitIdsByTreeGrid("/systems/District/disable")
            @x.Button("启 用").Icon("icon-ok2").Plain().SubmitIdsByTreeGrid("/systems/District/enable")
        @x.Button("刷 新").Icon("icon-refresh").Plain().RefreshByTreeGrid()
    </div>
}
@section content {
    @*右键菜单*@
    @Html.Partial("Menus/TreeGridMenu")
    @*查询表单*@
    @Html.Partial("Parts/QueryForm")
    @*表格*@
    @(x.TreeGrid("grid", "Code").Toolbar("divQuery").Url("/systems/District/query")
        .Menu().Fit().FitColumns().EnableDrag()
        .Columns(
            x.GridColumn(t => t.Id).CheckBox(),
            x.GridColumn(t => t.Code, 100, true),
            x.GridColumn(t => t.Name, 100, true),
            x.GridColumn(t => t.MergerName, 100, true),
            x.GridColumn(t => t.ShortName, 100, true),
            x.GridColumn(t => t.MergerShortName, 100, true),
            x.GridColumn(t => t.TelCode, 100, true),
            x.GridColumn(t => t.ZipCode, 100, true),
            x.GridColumn(t => t.PinYin, 100, true),
            x.GridColumn(t => t.FullPinYin, 100, true),
            x.GridColumn(t => t.English, 100, true),
            x.GridColumn(t => t.Longitude, 100, true),
            x.GridColumn(t => t.Latitude, 100, true),
            x.GridColumn(t => t.CodePath, 100, true),
            x.GridColumn(t => t.Enabled, 60, true),
            x.GridColumn(t => t.SortId, 100, true)
        )
    )
}